package org.example.leetcode;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/8/3 11:57
 * @version: 1.0
 */
public class LC35 {
    public static void main(String[] args) {
        LC35 lc=new LC35();
        int[] nums={1,3,5,7};
        int target=9;
        System.out.println(lc.searchInsert(nums,target));
    }

    public int searchInsert(int[] nums, int target) {

        for (int i = 0; i <nums.length ; i++) {
            if (target>=nums[i]){
                continue;
            }else {
                return i;
            }
        }
        return nums.length;
    }
}

